package com.myway.dto.lottery;

import org.springframework.util.StringUtils;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class DTOLotteryProduct implements Serializable {
	private static final long serialVersionUID = 5989212799502488650L;
	private Long id;
	private String productName;
	private String productType;
	private Date lotteryTime;
	private String segments;
	private String flightNos;
	private String depDate;
	private String airline;
	private Double lotteryRate;
	private Integer luckyCount;
	private Date autoLotteryTime;
	private Integer lineNumber;
	private Date createTime;
	private String productStatus;
	private BigDecimal price = new BigDecimal(0.00);
	private Integer winnerCount;
	private Date changeDeadline;
	private List<DTOLotteryList> dtoLotteryLists = new ArrayList<DTOLotteryList>();

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getProductName() {
		return productName;
	}

	public void setProductName(String productName) {
		this.productName = productName;
	}

	public String getProductType() {
		return productType;
	}

	public void setProductType(String productType) {
		this.productType = productType;
	}

	public Date getLotteryTime() {
		return lotteryTime;
	}

	public void setLotteryTime(Date lotteryTime) {
		this.lotteryTime = lotteryTime;
	}

	public String getSegments() {
		return segments;
	}

	public String getOrgCode() {
		if (StringUtils.hasText(segments)) {
			String[] s = segments.split("/");
			if (s.length == 2) {
				return s[0];
			}
		}
		return "";
	}

	public String getDstCode() {
		if (StringUtils.hasText(segments)) {
			String[] s = segments.split("/");
			if (s.length == 2) {
				return s[1];
			}
		}
		return "";
	}

	public void setSegments(String segments) {
		this.segments = segments;
	}

	public String getFlightNos() {
		return flightNos;
	}

	public void setFlightNos(String flightNos) {
		this.flightNos = flightNos;
	}

	public String getDepDate() {
		return depDate;
	}

	public void setDepDate(String depDate) {
		this.depDate = depDate;
	}

	public String getAirline() {
		return airline;
	}

	public void setAirline(String airline) {
		this.airline = airline;
	}

	public Double getLotteryRate() {
		return lotteryRate;
	}

	public void setLotteryRate(Double lotteryRate) {
		this.lotteryRate = lotteryRate;
	}

	public Integer getLuckyCount() {
		return luckyCount;
	}

	public void setLuckyCount(Integer luckyCount) {
		this.luckyCount = luckyCount;
	}

	public Date getAutoLotteryTime() {
		return autoLotteryTime;
	}

	public void setAutoLotteryTime(Date autoLotteryTime) {
		this.autoLotteryTime = autoLotteryTime;
	}

	public Integer getLineNumber() {
		return lineNumber;
	}

	public void setLineNumber(Integer lineNumber) {
		this.lineNumber = lineNumber;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getProductStatus() {
		return productStatus;
	}

	public void setProductStatus(String productStatus) {
		this.productStatus = productStatus;
	}

	public List<DTOLotteryList> getDtoLotteryLists() {
		return dtoLotteryLists;
	}

	public void setDtoLotteryLists(List<DTOLotteryList> dtoLotteryLists) {
		this.dtoLotteryLists = dtoLotteryLists;
	}

	public BigDecimal getPrice() {
		return price;
	}

	public void setPrice(BigDecimal price) {
		this.price = price;
	}

	public Integer getWinnerCount() {
		return winnerCount;
	}

	public void setWinnerCount(Integer winnerCount) {
		this.winnerCount = winnerCount;
	}

	public Date getChangeDeadline() {
		return changeDeadline;
	}

	public void setChangeDeadline(Date changeDeadline) {
		this.changeDeadline = changeDeadline;
	}

}
